#include<iostream>
#include<fstream>
using namespace std;
const int LEN = 500;
int cycle_str(char *s);
int main(int argc, char * argv[])
{
    char s[LEN];
    ifstream fin("in.txt", ios::in);
    if(!fin)
    {
        cerr<<"cannot open the file in.txt\n";
        return 1;
    }
    fin.getline(s, LEN, '\n');
    int cycles = cycle_str(s);
    cout << cycles <<endl;
    fin.close();
    return 0;
}

int cycle_str(char *s)
{
    int len = (int)strlen(s);
    for(int i=1; i<len; i++)
    {
        if(!(len%i))
        {
            bool ok = true;
            for(int j=i; j<len; j++)
            {
                if(s[j] != s[j%i])
                {
                    ok = false;
                    break;
                    
                }
            }
            if(ok)
                return i;
        }
    }
    return -1;
}

